package com.lancoo.ccas53.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lancoo.ccas53.config.MybatisRedisCache;
import com.lancoo.ccas53.entity.Course;
import com.lancoo.ccas53.pojo.dto.CourseDto;
import com.lancoo.ccas53.pojo.vo.CourseParameterSetVo;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 * 课程环节表 Mapper 接口
 * </p>
 *
 * @author quin.song
 * @since 2024-05-20
 */
@CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class)
public interface CourseMapper extends BaseMapper<Course> {

    int addBatch(@Param("courseCollection") Collection<Course> courseCollection);

    List<Course> getCourseByConditions(@Param("taskId") Integer taskId, @Param("baseCollegeId") String baseCollegeId, @Param("courseTypeId") String courseTypeId, @Param("courseNature") Integer courseNature,
                                       @Param("flag") Integer flag, @Param("keyword") String keyword, @Param("isSelect") Integer isSelect, @Param("isEnable") Integer isEnable);


    /**
     * 获取课程参数设置个数
     * @param taskId
     * @return
     */
    CourseParameterSetVo getCourseParameterSet(@Param("taskId") Integer taskId);

    /**
     * 获取课程部分字段
     * @param taskId
     * @return
     */
    List<CourseDto> getCourseDto(@Param("taskId") Integer taskId, @Param("baseCollegeId") String baseCollegeId, @Param("keyword") String keyword);

    List<Course> getCourseType(Integer taskId, String baseCollegeId);

    List<Integer> getCourseNature(Integer taskId, String baseCollegeId, String courseTypeId);

    List<Course> getCourseLimit(Integer taskId);

    void copyCourseLimit(Integer taskId, List<Course> courses);

    List<Course> getcourseList(Integer taskId);
}